/*
@author https://yunp.top
 */

@file:JsQualifier("starling.display")

package starling.display

import openfl.geom.Rectangle
import starling.textures.Texture

open external class Image(texture: Texture) : Quad {
    companion object {
        fun automateSetupForTexture(
            texture: Texture,
            onAssign: (image: Image) -> Unit,
            onRelease: (image: Image) -> Unit = definedExternally
        )

        fun bindPivotPointToTexture(texture: Texture, pivotX: Number, pivotY: Number)
        fun bindScale9GridToTexture(texture: Texture, scale9Grid: Rectangle)
        fun removeSetupForTexture(texture: Texture, onAssign: () -> Unit, onRelease: () -> Unit = definedExternally)
        fun resetSetupForTexture(texture: Texture)
    }

    var scale9Grid: Rectangle
    var tileGrid: Rectangle
}